📊 Logic Gates with Boolean Functions

Chapter 4 - ICT Grade 10

🎯 What You'll Learn:

  • Signals used in electronic science
  • Basic logic gates and combinational logic gates
  • Boolean expressions and truth tables
  • Creating digital circuits
  • Integrated Circuits (ICs)
  • Practical applications of logic gates

1. Introduction to Logic Gates

Just like we use signals in daily life (green light to go, red light to stop, horn on a train), computers also use signals to make decisions. These signals are processed through Logic Gates.

💡 What is a Logic Gate?

A Logic Gate is an electronic circuit that processes one or more input signals and produces an output signal based on a specific logical operation. Logic gates use binary values: 0 (False/Off) and 1 (True/On).

Real-Life Examples:

2. Basic Logic Gates

There are three fundamental logic gates:

🔹 AND Gate

Logic: Output is 1 only when ALL inputs are 1

Q = A.B
Think of it like: A door with a key AND a padlock - you need BOTH keys to open it.
A B Q (A.B)
000
010
100
111
⚠️ Important: If at least one input is 0, the output is always 0.

🔹 OR Gate

Logic: Output is 1 when AT LEAST ONE input is 1

Q = A + B
Think of it like: A two-door bus - you can exit from the front OR back door.
A B Q (A+B)
000
011
101
111
⚠️ Important: At least one input must be 1 for the output to be 1.

🔹 NOT Gate

Logic: Output is the COMPLEMENT (opposite) of the input

Q = Ā
Think of it like: A light switch - when it's ON (1), the output is OFF (0), and vice versa.
A Q (Ā)
01
10
⚠️ Important: NOT gate has only ONE input and ONE output.

3. Combinational Logic Gates

These gates are combinations of basic gates to create more complex operations:

🔸 NAND Gate (NOT + AND)

Logic: Complement of AND gate

Q = A.B̄
A B Q (A.B̄)
001
011
101
110
⚠️ Important: When both inputs are 1, output is 0. All other cases output is 1.

🔸 NOR Gate (NOT + OR)

Logic: Complement of OR gate

Q = A̅+̅B̅
A B Q (A̅+̅B̅)
001
010
100
110
⚠️ Important: When both inputs are 0, output is 1. All other cases output is 0.

4. Summary Comparison Table

Gate Boolean Expression Output is 1 when...
AND Q = A.B ALL inputs are 1
OR Q = A + B AT LEAST ONE input is 1
NOT Q = Ā Input is 0
NAND Q = A̅.̅B̅ At least one input is 0
NOR Q = A̅+̅B̅ ALL inputs are 0

5. Practical Applications (5 Real-World Examples)

📱 Example 1: Home Alarm System

An alarm system using OR gates to protect windows and doors:

  • Sensors on Window 1, Window 2, Front Door, Back Door
  • If ANY sensor detects opening (input = 1), alarm sounds
  • Uses OR gates because alarm should trigger if at least one entry point is opened
Q = W1 + W2 + FD + BD
💡 Why OR gate? Because the alarm should sound if Window 1 OR Window 2 OR Front Door OR Back Door is opened.

💡 Example 2: Street Light Control System

A circuit using multiple gates to control street lights:

  • Manual Switch (M): Light turns ON when switch is closed
  • Timer (T) + Light Sensor (L̄): Light turns ON when it's dark AND time is between 6 PM - 6 AM
  • Uses combination of AND, OR, and NOT gates
Q = M + (T.L̄)
💡 Why combination? Different conditions need different logic:
  • Manual override uses OR logic
  • Timer AND darkness uses AND logic
  • Light sensor complement uses NOT logic

🚗 Example 3: Car Safety System

A car warning system that alerts the driver when conditions are unsafe:

  • Seatbelt Warning: Alert sounds when engine is ON (E) AND seatbelt is NOT fastened (S̄)
  • Door Warning: Alert sounds when any door is open (D1, D2, D3, D4) AND car is moving (V)
  • Combined warning system: Alert = Seatbelt Warning OR Door Warning
Q = (E.S̄) + ((D1 + D2 + D3 + D4).V)
💡 Logic breakdown:
  • E.S̄ = Engine ON AND Seatbelt OFF
  • (D1+D2+D3+D4) = Any door open
  • (D1+D2+D3+D4).V = Any door open AND car moving

🏭 Example 4: Industrial Machine Safety Lock

A factory machine requires multiple safety conditions before operation:

  • Machine starts only when: Safety guard is closed (G) AND Emergency button is NOT pressed (Ē) AND Operator key is inserted (K) AND Power is ON (P)
  • All conditions must be met simultaneously
  • Uses multiple AND gates and one NOT gate
Q = G.Ē.K.P
💡 Why AND gates? ALL safety conditions must be satisfied before the dangerous machine can operate - if even one condition fails, the machine won't start.

🏠 Example 5: Smart Home Heating System

An intelligent heating system that optimizes comfort and energy:

  • Condition 1: Manual override switch (M) - heating ON regardless of other factors
  • Condition 2: Temperature is low (T) AND someone is home (H) AND NOT in vacation mode (V̄)
  • Condition 3: Schedule timer is active (S) AND temperature is low (T)
Q = M + (T.H.V̄) + (S.T)
💡 Complex logic: This system demonstrates how multiple conditions can be combined using AND and OR gates to create intelligent automation. The heating turns ON if ANY of the three main conditions are true.

6. Integrated Circuits (ICs)

What is an Integrated Circuit?

An Integrated Circuit (IC) is a tiny electronic circuit that contains many components (transistors, resistors, capacitors, diodes) packed into a small chip. Logic gates are implemented using ICs.

Features of ICs:

  • Small size - can fit many circuits in one package
  • Multiple pins for inputs and outputs
  • Used in computers, mobile phones, TVs, calculators, etc.
  • Modern microprocessors contain millions of logic gates

7. Practice Activities

📊 Truth Table Practice (5 Activities)

✏️ Activity 1: 3-Input OR Gate

Complete the truth table for:

Q = A + B + C
A B C Q = A + B + C
000?
001?
010?
011?
100?
101?
110?
111?

✏️ Activity 2: 3-Input NAND Gate

Complete the truth table for:

Q = A̅.̅B̅.̅C̅
A B C Q = A̅.̅B̅.̅C̅
000?
001?
010?
011?
100?
101?
110?
111?

✏️ Activity 3: Combined Expression (A + B).C

Complete the truth table for:

Q = (A + B).C
A B C A + B Q = (A + B).C
000??
001??
010??
011??
100??
101??
110??
111??

✏️ Activity 4: Combined Expression A.(B + C̄)

Complete the truth table for:

Q = A.(B + C̄)
A B C B + C̄ Q = A.(B + C̄)
000???
001???
010???
011???
100???
101???
110???
111???

✏️ Activity 5: NOR with 3 Inputs

Complete the truth table for:

Q = A̅+̅B̅+̅C̅
A B C Q = A̅+̅B̅+̅C̅
000?
001?
010?
011?
100?
101?
110?
111?

✍️ Boolean Expression Practice (5 Activities)

✏️ Activity 6: Safe Lock System

A high-security safe requires THREE keys (A, B, and C) to be inserted simultaneously to open. Write the Boolean expression for the lock mechanism.

✏️ Activity 7: Emergency Exit System

A building has 4 emergency exits (E1, E2, E3, E4). An alarm sounds if ANY of the emergency exits are opened. Write the Boolean expression.

✏️ Activity 8: Air Conditioning System

An air conditioner turns ON when the temperature sensor (T) indicates hot AND the humidity sensor (H) indicates high humidity. However, if the power-saving mode (P) is activated, the AC will NOT turn on. Write the Boolean expression.

✏️ Activity 9: Car Starting System

A car engine will start when: (Key is inserted (K) AND brake is pressed (B)) OR (Remote start button (R) is pressed AND car is in park mode (P)). Write the Boolean expression.

✏️ Activity 10: Automatic Light System

A room light turns ON automatically when: It's dark (light sensor D = 0) AND (motion is detected (M) OR door is opened (O)). Write the Boolean expression.

8. Exam-Style Questions & Answers

Question 1:

What is the output of an AND gate when one input is 1 and the other is 0?

Question 2:

How many rows will be in a truth table for a 4-input logic gate?

Question 3:

What is the difference between AND and NAND gates?

Question 4:

Write the Boolean expression for a 3-input NOR gate and describe when its output is 1.

Question 5:

A library door requires a student ID card (S) AND staff member approval (T) to open. Write the Boolean expression and create the truth table.

Question 6:

What type of gate would you use for a fire alarm system where the alarm should sound if smoke is detected OR heat is detected OR a manual alarm button is pressed?

Question 7:

Complete the truth table for the expression: Q = A.B̄

Question 8:

A vending machine dispenses a drink when: (Correct money is inserted (M) AND button is pressed (B)) OR (Service mode is activated (S)). Write the Boolean expression and explain the logic.

Question 9:

What is an Integrated Circuit (IC) and why are they important in modern electronics?

Question 10:

Design a burglar alarm system for a house with 2 windows (W1, W2) and 1 door (D). The alarm should sound if any window or the door is opened, BUT only if the security system is armed (A). Write the Boolean expression and draw a logic circuit diagram description.

9. Important Tips for Exams

📝 Key Points to Remember:

  • AND: All inputs must be 1 → output is 1
  • OR: At least one input is 1 → output is 1
  • NOT: Reverses the input (0→1, 1→0)
  • NAND: Opposite of AND (output 0 only when all inputs are 1)
  • NOR: Opposite of OR (output 1 only when all inputs are 0)
  • Number of truth table rows = 2n (n = number of inputs)
  • Boolean algebra uses "." for AND and "+" for OR
  • Bar over a variable (Ā) means complement/NOT operation

🎯 Drawing Truth Tables:

  1. Count the number of inputs (n)
  2. Calculate rows needed: 2n
  3. Write all possible input combinations (start with all 0s, end with all 1s)
  4. Apply the logic gate rules to find outputs
  5. Double-check your work!

10. Practice Resources

🖥️ Online Simulators:

  • Multimedia Logic (MM Logic): Free software to design and test logic circuits
  • Practice drawing circuits and observe how they work in real-time
  • Test your truth tables by simulating different input combinations

💪 Study Strategy:

  1. Memorize the basic truth tables for AND, OR, NOT
  2. Practice drawing circuit diagrams from Boolean expressions
  3. Work backwards - write Boolean expressions from given circuits
  4. Apply to real-world scenarios (alarms, lights, safes)
  5. Test yourself with past paper questions

Summary Checklist

✅ Before Your Exam, Make Sure You Can:

  • ☐ Draw symbols for all 5 logic gates
  • ☐ Write truth tables for all basic and combinational gates
  • ☐ Convert between Boolean expressions and logic circuits
  • ☐ Calculate the number of rows in a truth table (2n)
  • ☐ Identify which gate to use for different real-world scenarios
  • ☐ Complete truth tables for 3-input gates
  • ☐ Explain what Integrated Circuits are and their uses
  • ☐ Solve practical problems using logic gates